import type { PageParams } from '@/types/global'
import type {
  BannerHomeItem,
  GuessLikeItem,
  GuessLikeRes,
  HomeCategoryItem,
  HotPanelItem,
} from '@/types/home'
import { request } from '@/utils/request'

/**
 * 首页-广告区域-小程序
 */
export const getbannerHomeAPI = (distributionSite: number) => {
  return request<BannerHomeItem[]>('/home/banner', 'GET', {
    distributionSite,
  })
}

/**
 * 首页-前台分类-小程序
 */
export const getHomeCategoryMutli = () => {
  return request<HomeCategoryItem[]>('/home/category/mutli', 'GET')
}

/**
 * 首页-热门推荐-小程序
 */
export const getHomeHotMutli = () => {
  return request<HotPanelItem[]>('/home/hot/mutli', 'GET')
}

/**
 * 首页-猜你喜欢-小程序
 */
export const getHomeGoodsGuessLikeAPI = (params: PageParams) => {
  return request<GuessLikeRes<GuessLikeItem>>('/home/goods/guessLike', 'GET', params)
}
